﻿

function DrawPie(data,id) {
    //饼图的data:数据格式：{name：xxx,value:xxx}...
    var option = ECharts.ChartOptionTemplates.Pie(data);
    var container = document.getElementById(id);
    opt = ECharts.ChartConfig(container, option);
    ECharts.Charts.RenderChart(opt);
}
 

function DrawBar(data, id) {
    //柱形图的data:数据格式：{name：xxx,group:xxx,value:xxx}... 
    var option = ECharts.ChartOptionTemplates.Bars(data);
    var container = document.getElementById(id);
    opt = ECharts.ChartConfig(container, option);
    ECharts.Charts.RenderChart(opt);

}

function DrawLine(data, id) {
    //折现图的data:数据格式：{name：xxx,group:xxx,value:xxx}... 
    var option = ECharts.ChartOptionTemplates.Lines(data);
    var container = document.getElementById(id);
    opt = ECharts.ChartConfig(container, option);
    ECharts.Charts.RenderChart(opt);

}

function DrawK(data, id) {
    //的data:数据格式：{name：xxx,group:xxx,value:xxx}... 
    var option = ECharts.ChartOptionTemplates.K(data);
    var container = document.getElementById(id);
    opt = ECharts.ChartConfig(container, option);
    ECharts.Charts.RenderChart(opt);

}
function DrawFunnel(data, id) {
    //
    var option = ECharts.ChartOptionTemplates.funnel(data);
    var container = document.getElementById(id);
    opt = ECharts.ChartConfig(container, option);
    ECharts.Charts.RenderChart(opt);

}